(()=>{var e={45296:(e,t,i)=>{e.exports=i(83301)(1317)},24058:(e,t,i)=>{e.exports=i(83301)(1553)},33761:(e,t,i)=>{e.exports=i(83301)(2678)},70361:(e,t,i)=>{e.exports=i(83301)(306)},55267:(e,t,i)=>{e.exports=i(83301)(3305)},62059:(e,t,i)=>{e.exports=i(69547)(4225)},36733:(e,t,i)=>{e.exports=i(83301)(5385)},73920:(e,t,i)=>{e.exports=i(83301)(6305)},22355:(e,t,i)=>{e.exports=i(83301)(6917)},93155:(e,t,i)=>{e.exports=i(83301)(692)},16443:(e,t,i)=>{e.exports=i(83301)(7217)},7277:(e,t,i)=>{e.exports=i(69547)(8102)},9178:(e,t,i)=>{e.exports=i(83301)(8572)},27438:(e,t,i)=>{e.exports=i(83301)(8785)},33382:(e,t,i)=>{e.exports=i(83301)(9386)},11273:(e,t,i)=>{e.exports=i(83301)(9873)},83301:e=>{"use strict";e.exports=etsy_libs_45321960bdf3dd8daafb},69547:e=>{"use strict";e.exports=vendor_bundle_aadb8fbafd634bfbb65c}};var t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};e[n](s,s.exports,i);return s.exports}(()=>{i.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;i.d(t,{a:t});return t}})();(()=>{i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:true,get:t[n]})}})();(()=>{i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{"use strict";var e=i(33382);var t=i(16443);function n(i,n={}){const o="/api/v3/ajax/member/transcend/user-consent-preferences";const s={consent_payload:i};if(n){n.hasOwnProperty("is_confirmed")&&(s["is_confirmed"]=n["is_confirmed"]);n.hasOwnProperty("expiration_period_minutes")&&(s["expiration_period_minutes"]=n["expiration_period_minutes"]);n.hasOwnProperty("applicable_purposes")&&(s["applicable_purposes"]=n["applicable_purposes"]);n.hasOwnProperty("regional_experiences")&&(s["regional_experiences"]=n["regional_experiences"])}return{headers:{"x-csrf-token":(0,e["default"])(),"x-detected-locale":(0,t["default"])()},data:s,url:o,type:"POST"}}function o(i,n={}){const o="/api/v3/ajax/public/transcend/anonymous-consent-preferences";const s={consent_payload:i};if(n){n.hasOwnProperty("is_confirmed")&&(s["is_confirmed"]=n["is_confirmed"]);n.hasOwnProperty("expiration_period_minutes")&&(s["expiration_period_minutes"]=n["expiration_period_minutes"]);n.hasOwnProperty("applicable_purposes")&&(s["applicable_purposes"]=n["applicable_purposes"]);n.hasOwnProperty("regional_experiences")&&(s["regional_experiences"]=n["regional_experiences"])}return{headers:{"x-csrf-token":(0,e["default"])(),"x-detected-locale":(0,t["default"])()},data:s,url:o,type:"POST"}}var s=i(27438);var a=i(36733);var r=i(33761);var l=i(45296);var d=i(93155);var c=i(9178);var h=i.n(c);function u(i={}){const n="/api/v3/ajax/bespoke/member/user-preferences/gdpr";const o={};if(i){i.hasOwnProperty("third_party_consent")&&(o["third_party_consent"]=i["third_party_consent"]);i.hasOwnProperty("personalization_consent")&&(o["personalization_consent"]=i["personalization_consent"])}return{headers:{"x-csrf-token":(0,e["default"])(),"x-detected-locale":(0,t["default"])()},data:o,url:n,type:"POST"}}function p(e,t,i){t in e?Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true,writable:true}):e[t]=i;return e}class g{constructor(){p(this,"state",void 0);p(this,"elements",void 0);p(this,"listeners",void 0);this.elements={};this.listeners=[]}getState(){return this.state}setState(e,t){if("object"===typeof e)for(const i in e)void 0!==e[i]&&(this.state[i]=e[i]);else e in this.state&&void 0!==t&&(this.state[e]=t);this.notifyListeners()}addListener(e){this.listeners=this.listeners||[];this.listeners.push(e)}notifyListeners(){const e=this.getState();this.listeners=this.listeners||[];this.listeners.forEach((t=>{t(e)}))}setElements(e){this.elements={...this.elements,...e}}}const m=g;function v(){this._scrollBarWidth=null}v.prototype={scrollBarWidth(e){null===this._scrollBarWidth&&(this._scrollBarWidth=f());return _()||e?this._scrollBarWidth:0}};function _(){return document.body.scrollHeight>window.innerHeight}function f(){const e=document.createElement("div");e.style.visibility="hidden";e.style.width="100px";e.style.msOverflowStyle="scrollbar";document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const i=document.createElement("div");i.style.width="100%";e.appendChild(i);const n=i.offsetWidth;e.parentNode.removeChild(e);return t-n}const y=new v;var S=i(11273);const E="wt-html-no-scroll";const T="wt-body-no-scroll";const O=[];const C=function(){this.original_padding_right=0;this.original_scroll_top=0;this.container=null;this.uuid=(0,S["default"])()};C.prototype.isScrollingDisabled=function(){return O.indexOf(this.uuid)>=0&&document.body.classList.contains(T)};C.prototype.disableScrolling=function(){if(!this.isScrollingDisabled()){O.push(this.uuid);const e=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;const t=y.scrollBarWidth();this.original_padding_right=parseInt(document.body.style.paddingRight||0);this.original_scroll_top=e;document.body.classList.add(T);document.documentElement.classList.add(E);document.body.style.paddingRight=`${this.original_padding_right+t}px`;document.body.style.top=`${-1*e}px`}};C.prototype.enableScrolling=function(){if(this.isScrollingDisabled()){O.pop(this.uuid);setTimeout((()=>{document.body.style.paddingRight=this.original_padding_right;document.body.style.top="auto";document.body.classList.remove(T);document.documentElement.classList.remove(E);document.body.scrollTop=this.original_scroll_top;document.documentElement.scrollTop=this.original_scroll_top}),5)}};C.prototype.containScrolling=function(e){this.disableScrolling();this.container=e;this.container.style["overscroll-behavior"]="contain"};C.prototype.releaseScrolling=function(){this.enableScrolling();this.container&&this.container.style.removeProperty("overscroll-behavior")};const w=C;var b=i(62059);var A=i(7277);const I="alertdialog";const N="click";const P="[data-initial-focus]";const L=false;function x(e,t=P){const i=e.querySelector(t);const n=i||void 0;let o;n&&(o=()=>{n&&!(0,A.isFocusable)(n)&&n.setAttribute("tabindex","-1");return n});return o}function k(e,t,i){const{ariaRole:n,closeOnEsc:o,closeOnMaskClick:s,initialFocusSelector:a,maskSelector:r}=t;const l=x(e,a);const d=()=>{e.setAttribute("tabindex","-1");return e};const c=n!==I&&s;let h=null;let u=null;const p=e=>{let t=null;e.target instanceof Element&&(t=e.target);if(!c)return true;if(e.type!==N){u=t;return true}if(null===u||u!==t){u=null;return true}if(r&&null===t.closest(r)){u=null;return true}u=null;h&&t&&h({returnFocus:!(0,A.isFocusable)(t)});return false};const g=(0,b.createFocusTrap)(e,{escapeDeactivates:o,onDeactivate:i,initialFocus:l,fallbackFocus:d,clickOutsideDeactivates:L,allowOutsideClick:p,preventScroll:true});h=null===g||void 0===g?void 0:g.deactivate;return g}function R(e,t,i){t in e?Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true,writable:true}):e[t]=i;return e}class M{constructor(e){R(this,"timeout",null);R(this,"promise",void 0);this.promise=0===e?Promise.resolve():new Promise((t=>{this.timeout=setTimeout(t,e)}))}getPromise(){return this.promise}cancel(){this.timeout&&clearTimeout(this.timeout)}then(e){return this.promise.then(e)}}const D={ariaRole:"dialog",closeOnEsc:true,closeOnMaskClick:true,animateIn:true,animateOut:true,animationStyle:"fade",pageContentSelector:"#content, #gnav-header, #cnav-header, #gnav-footer, #desktop-category-nav, #collage-footer",modalContainerId:"wt-modal-container",customTrigger:false};const F={root:null,modal:null,globalModalContainer:null,globalPageContent:null};const U={default:"",large:"wt-overlay--large",info:"wt-overlay--info",alert:"wt-overlay--alert",peek:"wt-overlay--peek",peekRight:"wt-overlay--peek wt-overlay--peek-right",peekLeft:"wt-overlay--peek wt-overlay--peek-left",full:"wt-overlay--full-screen",video:"wt-overlay--video"};const B={IS_CLOSED:"isClosed",IS_OPENING:"isOpening",IS_OPEN:"isOpen",IS_CLOSING:"isClosing",IS_CANCELED:"isCanceled"};const G={openState:B.IS_CLOSED};const W={BEFORE_OPEN:"wtOverlayBeforeOpen",OPEN:"wtOverlayOpen",BEFORE_CLOSE:"wtOverlayBeforeClose",CLOSE:"wtOverlayClose",CANCEL:"wtOverlayCancel"};const j={WILL_ANIMATE:"wt-overlay--will-animate",ANIMATION_DONE:"wt-overlay--animation-done",ANIMATION_STYLE_GROW:"wt-overlay--animation-style-grow",NO_ANIMATION:"wt-overlay--no-animation",HAS_CLOSE_ICON:"wt-overlay--has-close-icon",DISPLAY_NONE:"wt-display-none"};const H={primary:"primary",secondary:"secondary",cancel:"cancel"};const $={filled:"filled",outline:"outline",transparent:"transparent",tertiary:"tertiary"};const q={OPEN_ANIMATION_TIMEOUT:300,CLOSE_ANIMATION_TIMEOUT:300,GROW_ANIMATION_TIMEOUT:350};const z={INITIAL_FOCUS_ELEMENT:"[data-overlay-initial-focus]"};const V={DEFAULT_OPTIONS:D,DEFAULT_ELEMENT_REFS:F,OVERLAY_TYPES:U,OPEN_STATES:B,INITIAL_STATE:G,EVENTS:W,CLASSES:j,ACTIONS_TYPES:H,CUSTOM_STYLE_TYPES:$,CSS_CONSTANTS:q,SELECTORS:z};const Y=V;var Q=i(55267);function J(e,t){if(e)return true;const i=new Error(t);false;Q["default"].captureException(i);return false}const K="wt-portals";const X=["wt-portal-blue","wt-portal-green","wt-portal-yellow","wt-portal-orange","wt-portal-red-orange","wt-portal-red"];const Z={"viewport-fixed":"wt-portal-blue","screen-covers":"wt-portal-green","alert-toasts":"wt-portal-yellow","anchored-panels":"wt-portal-orange","anchored-panels-with-triggers":"wt-portal-red-orange",tooltips:"wt-portal-red"};const ee={"wt-portal-blue":"default","wt-portal-green":"default","wt-portal-yellow":"default","wt-portal-orange":"default","wt-portal-red-orange":"top","wt-portal-red":"default"};function te(){var e;return"undefined"!==typeof document&&!!(null!==(e=document)&&void 0!==e&&e.getElementById)}function ie(e,t){if(te()){let i;t&&(i=document.getElementById(t));if(i)return i;let n=document.getElementById(K);if(!n){const e=document.createElement("div");e.setAttribute("id",K);document.body.appendChild(e);n=e}X.forEach((e=>{const t=document.getElementById(e);if(!t){var i;const t=document.createElement("div");t.setAttribute("id",e);t.style.zIndex="80";if("top"===ee[e]){t.style.position="absolute";t.style.top="0";t.style.left="0";t.style.width="100%";t.style.height="0"}else t.style.position="relative";null===(i=n)||void 0===i?void 0:i.appendChild(t)}}));const o=Z[e];const s=document.getElementById(o);if(t){i=document.createElement("div");i.setAttribute("id",t);null===s||void 0===s?void 0:s.appendChild(i);return i}return s}return null}function ne(e,t,i){t in e?Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true,writable:true}):e[t]=i;return e}class oe extends m{constructor(e,t,i){super();ne(this,"state",void 0);ne(this,"id",void 0);ne(this,"options",void 0);ne(this,"elements",void 0);ne(this,"_animationTimeout",void 0);ne(this,"_bodyScrollManager",void 0);ne(this,"_overlayFocusTrap",void 0);ne(this,"triggerPlaceholder",void 0);ne(this,"getInitialState",(()=>Y.INITIAL_STATE));ne(this,"initialize",(()=>{var e;this.elements.root instanceof HTMLElement&&(null===(e=this.elements.root)||void 0===e?void 0:e.classList.remove(Y.CLASSES.DISPLAY_NONE));this._bodyScrollManager=new w;this._setupFocusTrap()}));ne(this,"getGlobalModalContainer",(e=>{const t=ie("screen-covers",e);return t}));ne(this,"open",(()=>{var e;if(this._animationTimeout&&this.state.openState===Y.OPEN_STATES.IS_OPENING)return this._animationTimeout.getPromise();if(this.state.openState===Y.OPEN_STATES.IS_OPEN)return Promise.resolve();this._animationTimeout&&this._animationTimeout.cancel();this.elements.root&&this.elements.root.classList.add(Y.CLASSES.WILL_ANIMATE);null===(e=this._bodyScrollManager)||void 0===e?void 0:e.containScrolling(this.elements.root);this.setState({openState:Y.OPEN_STATES.IS_OPENING});"grow"===this.options.animationStyle?this._animationTimeout=this._applyGrowStyles("open"):this._animationTimeout=new M(this.options.animateIn?Y.CSS_CONSTANTS.OPEN_ANIMATION_TIMEOUT:0);if(this._animationTimeout){var t;return null===(t=this._animationTimeout)||void 0===t?void 0:t.then((()=>{this._openCompleted()}))}this._openCompleted();return}));ne(this,"cancel",(()=>{if(this._animationTimeout&&this.state.openState===Y.OPEN_STATES.IS_CLOSING)return this._animationTimeout.getPromise();if(this.state.openState===Y.OPEN_STATES.IS_CLOSED)return Promise.resolve();this.setState({openState:Y.OPEN_STATES.IS_CANCELED});return}));ne(this,"close",(()=>{if(this._animationTimeout&&this.state.openState===Y.OPEN_STATES.IS_CLOSING)return this._animationTimeout.getPromise();if(this.state.openState===Y.OPEN_STATES.IS_CLOSED)return Promise.resolve();this._animationTimeout&&this._animationTimeout.cancel();this.setState({openState:Y.OPEN_STATES.IS_CLOSING});this._releaseFocusTrap(true);"grow"===this.options.animationStyle?this._animationTimeout=this._applyGrowStyles("close"):this._animationTimeout=new M(this.options.animateOut?Y.CSS_CONSTANTS.CLOSE_ANIMATION_TIMEOUT:0);if(this._animationTimeout)return this._animationTimeout.then((()=>{this._closeCompleted()}));this._closeCompleted();return}));ne(this,"teardown",(()=>{this._animationTimeout&&this._animationTimeout.cancel();this._releaseScrollingLock();this._releaseFocusTrap(true);this._globalAriaHide()}));ne(this,"_openCompleted",(()=>{var e;this._animationTimeout=null;this._globalAriaShow();null===(e=this._overlayFocusTrap)||void 0===e?void 0:e.activate();this.setState({openState:Y.OPEN_STATES.IS_OPEN})}));ne(this,"_closeCompleted",(()=>{this._animationTimeout=null;this.elements.root&&this.elements.root.classList.remove(Y.CLASSES.WILL_ANIMATE);this._releaseScrollingLock();this._globalAriaHide();this.setState({openState:Y.OPEN_STATES.IS_CLOSED})}));ne(this,"_releaseScrollingLock",(()=>{var e;null===(e=this._bodyScrollManager)||void 0===e?void 0:e.releaseScrolling()}));ne(this,"_releaseFocusTrap",(e=>{if(e){var t;null===(t=this._overlayFocusTrap)||void 0===t?void 0:t.deactivate({onDeactivate:()=>{}})}else{var i;null===(i=this._overlayFocusTrap)||void 0===i?void 0:i.deactivate()}}));ne(this,"_applyGrowStyles",(e=>{const t=this._getTriggerElement();if(!J(t,"WtOverlay - To use grow animation (`animationStyle='grow'`), the overlay must have a trigger element with an`aria-controls` attribute matching the overlay id"))return new M(0);if(this.elements.modal&&t){const i=t.getBoundingClientRect();this.elements.modal.style.transition="none";this.elements.modal.style.transform="none";const n=this.elements.modal.getBoundingClientRect();this.elements.modal.style.transition="";this.elements.modal.style.transform="";if(!this.triggerPlaceholder){this.triggerPlaceholder=document.createElement("div");document.body.appendChild(this.triggerPlaceholder)}this.triggerPlaceholder.classList.add("wt-overlay__animation-placeholder");const o={left:"left",top:"top",width:"width",height:"height"};const s=["left","top","width","height"];s.forEach((e=>{this.triggerPlaceholder&&i&&(this.triggerPlaceholder.style[e]=`${i[e]}px`)}));const a=2;const r={x:n.left+.5*a-i.left,y:n.top+.5*a-i.top,width:(n.width-a)/i.width,height:(n.height-a)/i.height};const l=`translate3d(${r.x}px, ${r.y}px, 0px) scale(${r.width}, ${r.height})`;const d=e=>{requestAnimationFrame((()=>{requestAnimationFrame(e)}))};if("open"===e)d((()=>{if(this.triggerPlaceholder){this.triggerPlaceholder.classList.add("wt-overlay__animation-placeholder--open");this.triggerPlaceholder.style.transform=l}}));else{this.triggerPlaceholder.classList.add("wt-overlay__animation-placeholder--open");this.triggerPlaceholder.style.transform=l;d((()=>{if(this.triggerPlaceholder){this.triggerPlaceholder.classList.remove("wt-overlay__animation-placeholder--open");this.triggerPlaceholder.style.transform="translate3d(0, 0, 0) scale(1)"}}))}const c=1e3/60*2;const h=new M(Y.CSS_CONSTANTS.GROW_ANIMATION_TIMEOUT+c);h.then((()=>{setTimeout((()=>{this.triggerPlaceholder&&this.triggerPlaceholder.parentElement&&this.triggerPlaceholder.parentElement.removeChild(this.triggerPlaceholder);this.triggerPlaceholder=null}),50)}));return h}return null}));ne(this,"_getTriggerElement",(()=>{var e;const t=null===(e=this.elements.root)||void 0===e?void 0:e.id;const i=document.querySelector(`[aria-controls='${t}']`);return i}));ne(this,"_setupFocusTrap",(()=>{this.elements.modal instanceof HTMLElement&&(this._overlayFocusTrap=k(this.elements.modal,{...this.options,initialFocusSelector:Y.SELECTORS.INITIAL_FOCUS_ELEMENT,maskSelector:`#${this.options.modalContainerId}`},this.cancel))}));ne(this,"_globalAriaShow",(()=>{if(this.elements.globalModalContainer&&this.elements.globalPageContent)for(let e=0;e{if(this.elements.globalModalContainer&&this.elements.globalPageContent)for(let e=0;eY.INITIAL_STATE));ne(oe,"getGlobalModalContainer",(e=>{const t=ie("screen-covers",e);return t}));const se=oe;function ae(e){const t={...e.dataset};for(const i in t){const e=t[i];if("true"!==e&&"false"!==e)continue;t[i]="true"===e}return t}var re=i(22355);var le=i(73920);const de=le["default"].hasSupport("passiveEventListeners")?{passive:true}:{capture:false};const ce="--vh";const he="mobileViewportHeight";let ue=null;const pe=function(){if("undefined"!==typeof window){const e=.01*window.innerHeight;document.documentElement.style.setProperty(ce,`${e}px`)}};(0,re.onDOMReady)((()=>{if("undefined"===typeof window||!le["default"].hasSupport("cssVariables")||he in document.body.dataset)return;pe();window.addEventListener("resize",(()=>{ue&&window.cancelAnimationFrame(ue);ue=window.requestAnimationFrame(pe)}),de);document.body.dataset[he]="true"}));function ge(e,t,i){t in e?Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true,writable:true}):e[t]=i;return e}class me extends m{constructor(e,t){var i,n,o,s,a,r;super();ge(this,"state",void 0);ge(this,"element",void 0);ge(this,"elements",void 0);ge(this,"options",void 0);ge(this,"id",void 0);ge(this,"ariaRole",void 0);ge(this,"SELECTORS",void 0);ge(this,"triggers",void 0);ge(this,"closeButtons",void 0);ge(this,"overlayCore",void 0);ge(this,"_setupAnimateIn",(()=>{if(this.options.animateIn){var e;null===(e=this.elements.root)||void 0===e?void 0:e.classList.remove(Y.CLASSES.NO_ANIMATION)}else{var t;null===(t=this.elements.root)||void 0===t?void 0:t.classList.add(Y.CLASSES.NO_ANIMATION)}}));ge(this,"_setupAnimateOut",(()=>{if(this.options.animateOut){var e;null===(e=this.elements.root)||void 0===e?void 0:e.classList.remove(Y.CLASSES.NO_ANIMATION)}else{var t;null===(t=this.elements.root)||void 0===t?void 0:t.classList.add(Y.CLASSES.NO_ANIMATION)}}));ge(this,"_setupTriggers",(()=>{this.triggers=document.querySelectorAll(`button[aria-controls="${this.id}"]`);Array.prototype.map.call(this.triggers,(e=>{this.overlayCore&&e.addEventListener("click",this.overlayCore.open.bind(this.overlayCore))}),this)}));ge(this,"_setupCloseButtons",(()=>{var e;this.closeButtons=(null===(e=this.element)||void 0===e?void 0:e.querySelectorAll(this.SELECTORS.CLOSE_BUTTON))||null;this.closeButtons&&Array.prototype.map.call(this.closeButtons,(e=>{this.overlayCore&&e.addEventListener("click",this.overlayCore.cancel.bind(this.overlayCore))}),this)}));ge(this,"_moveIntoContainer",(()=>{var e;this.element&&(null===(e=this.elements.globalModalContainer)||void 0===e?void 0:e.appendChild(this.element))}));ge(this,"handleStateChange",(e=>{switch(e){case Y.OPEN_STATES.IS_OPENING:this._handleOpening();break;case Y.OPEN_STATES.IS_OPEN:this._handleOpen();break;case Y.OPEN_STATES.IS_CANCELED:this._handleCancelled();break;case Y.OPEN_STATES.IS_CLOSING:this._handleClosing();break;case Y.OPEN_STATES.IS_CLOSED:this._handleClosed();break;default:break}}));ge(this,"_handleOpening",(()=>{var e,t,i;null===(e=this.elements.root)||void 0===e?void 0:e.dispatchEvent(new CustomEvent(Y.EVENTS.BEFORE_OPEN));null===(t=this.elements.root)||void 0===t?void 0:t.setAttribute("aria-hidden","false");null===(i=this.elements.root)||void 0===i?void 0:i.setAttribute("aria-modal","true")}));ge(this,"_handleOpen",(()=>{var e,t;null===(e=this.elements.modal)||void 0===e?void 0:e.classList.add(Y.CLASSES.ANIMATION_DONE);null===(t=this.elements.root)||void 0===t?void 0:t.dispatchEvent(new CustomEvent(Y.EVENTS.OPEN));this._setupAnimateOut()}));ge(this,"_handleCancelled",(()=>{var e;null===(e=this.elements.root)||void 0===e?void 0:e.dispatchEvent(new CustomEvent(Y.EVENTS.CANCEL));this.close()}));ge(this,"_handleClosing",(()=>{var e,t,i,n;null===(e=this.elements.root)||void 0===e?void 0:e.dispatchEvent(new CustomEvent(Y.EVENTS.BEFORE_CLOSE));null===(t=this.elements.modal)||void 0===t?void 0:t.classList.remove(Y.CLASSES.ANIMATION_DONE);null===(i=this.elements.root)||void 0===i?void 0:i.setAttribute("aria-modal","false");null===(n=this.elements.root)||void 0===n?void 0:n.setAttribute("aria-hidden","true")}));ge(this,"_handleClosed",(()=>{var e;null===(e=this.elements.root)||void 0===e?void 0:e.dispatchEvent(new CustomEvent(Y.EVENTS.CLOSE));this._setupAnimateIn()}));ge(this,"open",(()=>{var e;return null===(e=this.overlayCore)||void 0===e?void 0:e.open()}));ge(this,"close",(()=>{var e;return null===(e=this.overlayCore)||void 0===e?void 0:e.close()}));ge(this,"cancel",(()=>{var e;return null===(e=this.overlayCore)||void 0===e?void 0:e.cancel()}));this.state=Y.INITIAL_STATE;this.element=e;this.id=(null===(i=this.element)||void 0===i?void 0:i.getAttribute("id"))||void 0;this.elements={};this.overlayCore=null;this.ariaRole=(null===(n=this.element)||void 0===n?void 0:n.getAttribute("role"))||null;this.triggers=null;this.closeButtons=null;this.SELECTORS={MODAL_ELEMENT:"[data-overlay-modal]",CLOSE_BUTTON:"[data-wt-overlay-close]"};const l=(null===(o=this.element)||void 0===o?void 0:o.querySelector(this.SELECTORS.MODAL_ELEMENT))||null;const d=this.element?ae(this.element):{};this.options=Object.assign({},Y.DEFAULT_OPTIONS,t,{ariaRole:this.ariaRole},d);if(null!==(s=this.options)&&void 0!==s&&s.modalContainerId&&null!==(a=this.options)&&void 0!==a&&a.pageContentSelector){this.elements={root:this.element,modal:l,globalModalContainer:se.getGlobalModalContainer(this.options.modalContainerId),globalPageContent:document.querySelectorAll(this.options.pageContentSelector)};this.overlayCore=new se(this.id,this.options,this.elements);this.overlayCore.initialize();this.overlayCore.addListener((e=>{this.handleStateChange(e.openState)}))}if(!J(e,"WtOverlay - The element provided to the constructor does not exist"))return;if(!J(l,"WtOverlay - The [data-overlay-modal] child does not exist"))return;this._setupAnimateIn();this._moveIntoContainer();null!==(r=this.options)&&void 0!==r&&r.customTrigger||this._setupTriggers();this._setupCloseButtons()}}const ve=me;const _e="gdprSettingsPromptClosed";const fe="data-gdpr-consent-prompt-open-automatically";const ye="[data-gdpr-consent-prompt]";function Se(){const e=document.querySelector(ye);return"true"===(null===e||void 0===e?void 0:e.getAttribute(fe))}function Ee(e){document.addEventListener(_e,(()=>{e.openOverlay()}))}function Te(e){this.manager=e;this.overlayContainer=e.el.find("[data-gdpr-settings-overlay]");this.isThirdPartyConsent=this.overlayContainer.hasClass("third-party-settings");this.openModalEventName=this.isThirdPartyConsent?"third_party_settings_shown":"full_settings_shown";this.overlay=new ve(this.overlayContainer[0],{closeOnEsc:false,closeOnMaskClick:false});this.footerSettingsTrigger=h()("[data-gdpr-privacy-settings-trigger]");this.requests={};this.savedTimeout=null;this.setUpHandlers()}Te.HEADER_SELECTOR="h2";Te.SAVED_INDICATOR_DURATION=5e3;Te.SUCCESS_ALERT_DURATION=5e3;Te.prototype={setUpHandlers(){this.overlayContainer[0].addEventListener("wtOverlayOpen",this.onOpen.bind(this));this.overlayContainer.on("click","a",(e=>this.manager.handleLinkClick("full_settings",e)));this.isPrivacyPage()?this.setUpScrollToPrivacyPageSettingsSection():this.footerSettingsTrigger.on("click",this.open.bind(this))},setUpScrollToPrivacyPageSettingsSection(){this.footerSettingsTrigger.on("click",(e=>{e.preventDefault();const t=h()("#privacy-settings").offset().top;h()("html, body").animate({scrollTop:t},"slow")}))},switchToFullSettings(){this.manager.logEvent("change_settings_clicked");this.manager.closeSingleChoiceSettings().then((()=>{this.open()}))},open(){this.manager.logEvent(this.openModalEventName);this.overlay.open();l["default"].increment(`gdpr.consent.ui.prompt.${this.openModalEventName}`);return false},close(){const e=this.overlayContainer.find("[data-gdpr-toggle]");const t={};let i=false;e.each((function(){if(!h()(this).data("modified")){i=true;t[h()(this).attr("name")]=h()(this).is(":checked")}}));i&&this.manager.persistSettings(t).then(this.manager.displaySaveConfirmation);const n=new Event(_e);document.dispatchEvent(n);this.overlay.close()},onOpen(){this.overlayContainer.parent(".overlay-content-wrapper").addClass("gdpr-overlay-content-wrapper");this.overlayContainer.find("button[data-wt-overlay-close]").on("click",this.close.bind(this));h()("[data-gdpr-toggle]").on("change",this.updateSetting.bind(this));this.adjustLabels()},toggleGDPRSwitchesOff(){const e=this.overlayContainer.find("[data-gdpr-toggle]");const t=this.overlayContainer;e.each((function(){this.checked=false;const e=t.find(`[for = "${this.id}"].wt-text-caption`)[0];e&&(e.textContent=this.getAttribute(`data-unchecked-label`))}))},toggleGDPRSwitchesOn(){const e=this.overlayContainer.find("[data-gdpr-toggle]");const t=this.overlayContainer;e.each((function(){this.checked=true;const e=t.find(`[for = "${this.id}"].wt-text-caption`)[0];e&&(e.textContent=this.getAttribute(`data-checked-label`))}))},updateSetting(e){const t=h()(e.target);const i=t.attr("id");const n=h()(e.target).closest("[data-section]").find("[data-gdpr-toggle-label]");let o;o=t.is(":checked")?t.data("checked-label"):t.data("unchecked-label");n.html(o);t.attr("disabled",true);t.data("modified",true);const s={};s[i]=t.is(":checked");const a=this.manager.persistSettings(s);a.always((()=>{t.attr("disabled",false);t.trigger("focus")}));this.handleSaving(i,a)},handleSaving(e,t){t.always((()=>{this.handleSaved(e,t)}));this.requests[e]=t;h()("[data-saving-indicator]").removeClass("wt-display-none");h()("[data-saved-indicator]").addClass("wt-display-none");this.savedTimeout&&window.clearTimeout(this.savedTimeout)},handleSaved(e,t){this.requests[e]=null;let i=true;for(const n in this.requests)if(Object.prototype.hasOwnProperty.call(this.requests,n)&&this.requests[n]){i=false;return}if(i){const e=h()("[data-saving-indicator]",this.overlayContainer);const t=h()("[data-saved-indicator]",this.overlayContainer);e.addClass("wt-display-none");t.removeClass("wt-display-none");this.savedTimeout=window.setTimeout((()=>{t.hide();this.savedTimeout=null}),Te.SAVED_INDICATOR_DURATION)}},adjustLabels(){h()("[data-section]",this.overlayContainer).each((function(){const e=h()(this).data("section");const t=`settings-title-${e}`;h()(this).find(Te.HEADER_SELECTOR).attr("id",t);h()(this).find("[data-gdpr-toggle]").attr("aria-labelledby",t)}))},isPrivacyPage(){return"/your/account/privacy"===window.location.pathname}};const Oe=Te;var Ce=i(70361);function we(e){this.manager=e;this.overlayContainer=e.el.find("[data-gdpr-single-choice-overlay]");this.overlayReduxContainer=e.el.find("[data-gdpr-single-choice-overlay-redux]");this.overlayReduxWtOverlay=null;this.footerSettingsTrigger=h()("[data-gdpr-privacy-settings-trigger]");this.requests={};this.savedTimeout=null;this.setUpHandlers()}we.HEADER_SELECTOR="h2";we.SAVED_INDICATOR_DURATION=5e3;we.SUCCESS_ALERT_DURATION=5e3;we.prototype={setUpHandlers(){const e=this.overlayContainer.add(this.overlayReduxContainer);e.find("[data-gdpr-single-choice-accept]").on("click",this.acceptAll.bind(this));e.find("[data-gdpr-open-full-settings]").on("click",this.switchToFullSettings.bind(this));e.on("click","[data-gdpr-single-choice-reject]",this.essentialOnly.bind(this));e.on("click","a",(e=>this.manager.handleLinkClick("single_choice",e)))},switchToFullSettings(){this.manager.logEvent("change_settings_clicked");return this.close().then(this.manager.openFullSettings)},open(){if(0!==this.overlayContainer.length){this.overlayContainer.show();Ce["default"].containFocusInElement(this.overlayContainer);Ce["default"].setFocusToFirstFocusableElement(this.overlayContainer)}else{if(0===this.overlayReduxContainer.length){this.manager.logEvent("single_choice_container_missing");l["default"].increment("gdpr.consent.ui.prompt.single_choice_container_missing");return}this.overlayReduxWtOverlay=new ve(this.overlayReduxContainer[0],{closeOnEsc:false,closeOnMaskClick:false});this.overlayReduxWtOverlay.open()}this.manager.logEvent("single_choice_shown");l["default"].increment("gdpr.consent.ui.prompt.single_choice_shown")},close(){Ce["default"].removeContainFocus();this.overlayContainer.hide();return this.overlayReduxWtOverlay?this.overlayReduxWtOverlay.close():Promise.resolve()},essentialOnly(e){this.manager.handleEssentialOnly();const t=this.manager.persistSettings({personalization_consent:false,third_party_consent:false}).then(this.manager.displaySaveConfirmation);const i=new Event(_e);document.dispatchEvent(i);this.close();return t},acceptAll(e){this.manager.handleAcceptAll();const t=this.manager.persistSettings({personalization_consent:true,third_party_consent:true}).then(this.manager.displaySaveConfirmation);const i=new Event(_e);document.dispatchEvent(i);this.close();return t}};const be=we;var Ae=i(24058);function Ie(){return Array.from(window.airgap.getRegimePurposes())}function Ne(){return Array.from(window.airgap.getRegimes())}const Pe=function(){let e=null;function t(e){d["default"].getBoolean("dynamic_privacy_settings_ui_enabled")||this.intializeModal(e)}t.getInstance=function(i){e||(e=new t(i));return e};t.resetInstance=function(){e=null};return t}();Pe.prototype={checkForOpenAutomatically(){this.singleChoiceSettings&&this.el.data("gdpr-consent-prompt-open-automatically")&&this.singleChoiceSettings.open()},openFullSettings(){this.fullSettings.open()},closeSingleChoiceSettings(){return this.singleChoiceSettings.close()},persistSettings(e){return d["default"].getBoolean("dual_write_enabled")?h().when(h().ajax(u(e)),this.setTranscendPreferences(e)):h().ajax(u(e))},setTranscendPreferences(e){const t={};Object.hasOwn(e,"personalization_consent")&&(t.Functional=e.personalization_consent?"true":"false");Object.hasOwn(e,"third_party_consent")&&(t.Advertising=e.third_party_consent?"true":"false");const i={timestamp:(new Date).toISOString(),purposes:t};const s={is_confirmed:true,expiration_period_minutes:window.airgap.loadOptions.consentExpiry,applicable_purposes:Array.from(window.airgap.getRegimePurposes()),regional_experiences:Array.from(window.airgap.getRegimes())};const r=a["default"].getSignedInUserId();return r?h().ajax(n(i,s)):h().ajax(o(i,s))},handleEssentialOnly(){this.logEvent("essential_only");this.fullSettings.toggleGDPRSwitchesOff()},handleAcceptAll(){this.logEvent("accept_all");this.fullSettings.toggleGDPRSwitchesOn()},displaySaveConfirmation(){const e=h()(this.consentSuccessAlert);h()("body").append(e);setTimeout((()=>{e.remove()}),Oe.SUCCESS_ALERT_DURATION)},handleLinkClick(e,t){t.preventDefault();const i=h()(t.target).attr("href");this.logEvent("link_clicked",{overlay_source:e,link_url:i});const n=window.open(`${i}?ref=pv_ol`,"_blank");n||(window.location.href=`${i}?ref=pv_ol`)},logEvent(e,t={}){const i=t||{};i["event_name"]=`gdpr_consent_prompt_${e}`;r["default"].logEvent(i)},initializeModalFromAPISpec(){Ae["default"].fetchOne("transcend_consent_modal","GDPR_ApiSpecs_ConsentPrompt",{purposes:Ie(),regimes:Ne()},"POST",[]).then((e=>{h()("#gdpr-privacy-settings").replaceWith(e.output.transcend_consent_modal);this.intializeModal()})).fail((()=>{r["default"].logEvent({event_name:"dynamic_privacy_settings_ui_apispec_failed"})}))},intializeModal(e){const t=e||h()("[data-gdpr-consent-prompt]");this.el=h()(t);if(0===this.el){r["default"].logEvent({event_name:"privacy_settings_empty_inputEl"});return}const i=this.el.find("[data-gdpr-settings-overlay]");if(0===i.length){r["default"].logEvent({event_name:"privacy_settings_empty_fullSettingsOverlayContainer"});return}this.consentSuccessAlert=this.el.find("[data-gdpr-consent-success-alert]").text();this.openFullSettings=this.openFullSettings.bind(this);this.displaySaveConfirmation=this.displaySaveConfirmation.bind(this);this.fullSettings=new Oe(this);this.singleChoiceSettings=new be(this)}};const Le=Pe;var xe;async function ke(){await window.airgap.sync();const e=a["default"].getSignedInUserId();if(d["default"].getBoolean("dual_write_enabled"))if(e){const e=n(window.airgap.getConsent(),{is_confirmed:false,expiration_period_minutes:window.airgap.loadOptions.consentExpiry,applicable_purposes:Array.from(window.airgap.getRegimePurposes()),regional_experiences:Array.from(window.airgap.getRegimes())});(0,s["default"])(e).then((e=>{e.ok?l["default"].increment(`privacy.transcend.user.save_preference.success`):l["default"].increment(`privacy.transcend.user.save_preference.failed`)}))}else{const e=o(window.airgap.getConsent(),{is_confirmed:false,expiration_period_minutes:window.airgap.loadOptions.consentExpiry,applicable_purposes:Array.from(window.airgap.getRegimePurposes()),regional_experiences:Array.from(window.airgap.getRegimes())});(0,s["default"])(e).then((e=>{e.ok?l["default"].increment(`privacy.transcend.anonymous.save_preference.success`):l["default"].increment(`privacy.transcend.anonymous.save_preference.failed`)}))}}if(!(null!==(xe=self.airgap)&&void 0!==xe&&xe.ready)){var Re;self.airgap={...null===(Re=self)||void 0===Re?void 0:Re.airgap,readyQueue:[],ready(e){var t;null===(t=this.readyQueue)||void 0===t?void 0:t.push(e)}}}self.airgap.ready((()=>{r["default"].logEvent({event_name:`transcend_cmp_airgap_loaded`,airgap_url:d["default"].getString("airgap_url"),airgap_bundle:d["default"].getString("airgap_bundle"),regimes:window.airgap.getRegimes()});ke();if(d["default"].getBoolean("dynamic_privacy_settings_ui_enabled")){const e=Le.getInstance(null);e.initializeModalFromAPISpec()}}))})()})(); //# sourceMappingURL=https://www.etsy.com/sourcemaps/evergreenVendor/es/@etsy-modules/ConsentManagement/Transcend-Integration.0308b1778bb8c5256a53.js.map